<template>
  <div id="client">
    <p style="margin-left: 20px; margin-bottom: 20px">
      <span class="demonstration" style="margin-left: 20px">单据日期：</span>
      <el-date-picker
        v-model="value2"
        type="daterange"
        align="right"
        unlink-panels
        range-separator="至"
        start-placeholder="开始日期"
        end-placeholder="结束日期"
        :picker-options="pickerOptions"
      >
      </el-date-picker>
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 客户类别：<el-select
        v-model="value"
        placeholder="客户类别"
        style="width: 120px"
      >
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        >
        </el-option>
      </el-select>
      &nbsp;&nbsp;&nbsp;客户：<el-input
        style="width: 180px; margin-left: 10px; margin-right: 20px"
        placeholder="请选择"
        v-model="input"
        clearable
      ></el-input>
      <el-button
        style="margin-left: -20px; margin-right: 10px"
        @click="dialogFormVisible = true"
        >...</el-button
      >
      &nbsp;&nbsp;&nbsp;
    </p>
    <p style="margin-left: 40px">
      销售人员<el-input
        style="width: 180px; margin-left: 10px; margin-right: 20px"
        placeholder="请选择"
        v-model="input"
        clearable
      ></el-input>
      <el-button
        style="margin-left: -20px; margin-right: 10px"
        @click="dialogFormVisible = true"
        >...</el-button
      >
      销售单号：<el-input
        style="width: 180px; margin-left: 10px; margin-right: 20px"
        placeholder="请输入销售单号查询"
        v-model="input"
        clearable
      ></el-input>
      <input type="checkbox" />销货&nbsp;&nbsp;<input
        type="checkbox"
      />退货&nbsp;&nbsp;<input type="checkbox" />回款率100%不显示
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp;
      <el-button type="primary">查询</el-button>
    </p>
    <el-divider style="width: 1500px"></el-divider>
    <p style="text-align: center; margin-top: 20px; width: 100%">
      <span style="font-weight: bolder; font-size: 22px">销售收款一览表</span>
      <span style="display: inline-block; float: right">
        <el-button type="primary">导出</el-button>
        <el-button>打印</el-button>
      </span>
    </p>
    <el-table :data="tableData" height="400" border style="width: 100%">
      <el-table-column prop="clienttype" label="客户类别" width="150px">
      </el-table-column>
      <el-table-column prop="name" label="客户" width="150px">
      </el-table-column>
      <el-table-column prop="clientaddress" label="客户地址" width="150px">
      </el-table-column>
      <el-table-column prop="saleman" label="销货员" width="150px">
      </el-table-column>
      <el-table-column prop="type" label="业务类别" width="150px">
      </el-table-column>
      <el-table-column prop="date" label="单据日期" width="120">
      </el-table-column>
      <el-table-column prop="id" label="单据编号" width="120">
      </el-table-column>
      <el-table-column prop="price" label="销售金额" width="150px">
      </el-table-column>
      <el-table-column prop="lastmoney" label="优惠后金额" width="150px">
      </el-table-column>
      <el-table-column prop="clientpaymoney" label="客户承担费用" width="150px">
      </el-table-column>
      <el-table-column prop="nowmoney" label="本次收款" width="150px">
      </el-table-column>
      <el-table-column prop="remaindermoney" label="应本收款余额" width="150px">
      </el-table-column>
      <el-table-column prop="rate" label="回款率" width="150px">
      </el-table-column>
      <el-table-column prop="text" label="备注" width="150px">
      </el-table-column>
    </el-table>
    <el-dialog top="20px" title="添加业务员" :visible.sync="dialogFormVisible">
      <el-input
        v-model="input"
        placeholder="请输入编号或名称"
        style="width: 200px; margin-left: 20px"
      ></el-input>
      <el-checkbox v-model="checked" style="margin-left: 20px"
        >显示禁用职员</el-checkbox
      >
      <el-button type="success" style="margin-left: 20px">查询</el-button>
      <el-table :data="gridData">
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column
          width="100"
          property="name"
          label="类别"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="编号"
        ></el-table-column>
        <el-table-column
          width="300"
          property="address"
          label="名称"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="联系人"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="手机"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="备注"
        ></el-table-column>
      </el-table>
      <div class="block">
        <span class="demonstration"></span>
        <el-pagination layout="prev, pager, next" :total="1000">
        </el-pagination>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible = false"
          >确 定</el-button
        >
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      dialogFormVisible: false,
      gridData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
      ],
      tableData: [
        {
          clienttype: "VIP",
          name: "客户甲",
          clientaddress: "北京市海淀区中关村",
          saleman: "销货员A",
          type: "电子产品",
          date: "2024-01-01",
          id: "D001",
          price: 2000,
          lastmoney: 1900,
          clientpaymoney: 1500,
          nowmoney: 1000,
          remaindermoney: 500,
          rate: "80%",
          text: "无特殊要求",
        },
        {
          clienttype: "普通客户",
          name: "客户乙",
          clientaddress: "上海市浦东新区世纪大道",
          saleman: "销货员B",
          type: "日用品",
          date: "2024-01-02",
          id: "D002",
          price: 1500,
          lastmoney: 1450,
          clientpaymoney: 1200,
          nowmoney: 800,
          remaindermoney: 300,
          rate: "70%",
          text: "需提供发票",
        },
        {
          clienttype: "VIP",
          name: "客户丙",
          clientaddress: "广州市天河区珠江新城",
          saleman: "销货员C",
          type: "食品",
          date: "2024-01-03",
          id: "D003",
          price: 3000,
          lastmoney: 2900,
          clientpaymoney: 2500,
          nowmoney: 2000,
          remaindermoney: 400,
          rate: "85%",
          text: "加急处理",
        },
        {
          clienttype: "普通客户",
          name: "客户丁",
          clientaddress: "深圳市南山区科技园",
          saleman: "销货员D",
          type: "化妆品",
          date: "2024-01-04",
          id: "D004",
          price: 1200,
          lastmoney: 1150,
          clientpaymoney: 1000,
          nowmoney: 700,
          remaindermoney: 200,
          rate: "65%",
          text: "需提供售后服务",
        },
      ],
      dialogFormVisible: false,
      value2: "",
    };
  },
  methods: {
    goto(to) {
      if (this.$route.path !== "/" + to) {
        this.$router.push(to);
      }
    },
  },
};
</script>

<style scoped>
.el-button el-button--default el-popover__reference {
  margin-right: 20px;
}

tr {
  border: 1px solid black;
}
</style>